
#include "Sprite.h"
#include "Exception.h"
#include "BltInfo.h"

namespace Graphics
{
	Sprite::Sprite(void):
		m_ZoomX(1.0f),
		m_ZoomY(1.0f),
		m_pImage(0),
		m_pInfo(new BltInfo())
	{
	}

	Sprite::~Sprite(void)
	{
		delete m_pInfo;
	}

	void Sprite::SetZoomX(float zx)
	{
		if(zx <= 0) 
		{
			throw(VaildValue());
		}
		m_ZoomX = zx;
	}
	
	void Sprite::SetZoomY(float zy)
	{
		if(zy <= 0) 
		{
			throw(VaildValue());
		}
		m_ZoomY = zy;
	}

	const float& Sprite::GetZoomX(void) const
	{
		return m_ZoomX;
	}

	const float& Sprite::GetZoomY(void) const
	{
		return m_ZoomY;
	}

	void Sprite::SetZoom(float z)
	{
		this->SetZoomX(z);
		this->SetZoomY(z);
	}

	Drawable* const Sprite::GetImage() const
	{
		return m_pImage;
	}

	void Sprite::SetImage(Drawable* pImage)
	{
		m_pImage = pImage;
	}

	BltInfo& Sprite::GetInfo(void)
	{
		return *m_pInfo;
	}
}